package stjohns.hfoss.mercurialtest;
import java.util.ArrayList;

/**
 * This is a class that tests the Cat class
 * It is intended for lab7
 * @author Bonnie MacKellar
 */
public class CatTester {
	

    public static void main(String[] args)
    {
          ArrayList<Cat> myCats = new ArrayList<Cat>();

          Cat cat1 = new Cat("Zoe", "black","1");
          myCats.add(cat1);
          Cat cat2 = new Cat("Fluffy", "gray","2");
          myCats.add(cat2);
          Cat cat3 = new Cat("Spot", "spotted","3");
          myCats.add(cat3);
          Cat cat4 = new Cat("Garfield", "orange","4");
          myCats.add(cat4);
          Cat cat5 = new Cat("Xander", "gray","5");
          myCats.add(cat5);

          myCats.get(0).meow();
          int numGray = countColors(myCats,"gray");
    }
    
    static public int countColors(ArrayList<Cat> myCats, String color)
	  {
		int count = 0;
		 for(Cat cat:myCats)
		 {
		  if (cat.getColor().equals(color))
			  count++;
		 }
		 return count;
	  }
}
